package engine.graphics;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Set;

public class SpriteSheet implements Serializable{

	private static final long serialVersionUID = 1L;

	private HashMap<String, Sprite> sprites ; 
	
	public SpriteSheet(){
		sprites = new HashMap<String, Sprite>(); 
	}
	
	public SpriteSheet(String[] names, Sprite[] sprites){
		this(); 
		if(names.length == sprites.length){
			for(int i=0; i<names.length; i++)
				this.sprites.put(names[i], sprites[i]); 
		}
	}
	
	public Sprite getSpriteByName(String name){
		return sprites.get(name);
	}
	
	public void addNewSprite(String name, Sprite sprite){
		this.sprites.put(name, sprite); 
	}
	
	public int getSize(){
		return sprites.size();
	}
	
	public Set<String> getKeySet(){
		return this.sprites.keySet(); 
	}
}
